<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/select.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="artDialog/skins/default.css"
	type="text/css"></link>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>
<script type="text/javascript" src="artDialog/artDialog.min.js"></script>
<script type="text/javascript" src="artDialog/jquery.artDialog.min.js"></script>
<script type="text/javascript" src="artDialog/artDialog.plugins.min.js"></script>

<script type="text/javascript" src="js/util.js"></script>

<script language="javascript"  type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
  
<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 167  
	});
	$(".select3").uedSelect({
		width : 120
	});
	
	findcircuitry(1,10);//查询所有

	
	$.post("route!findList.action",function(data){
		var arr = eval("("+data+")");
		/* alert(arr); */
		var html = $("#routeNo").html();
		for(var i =0;i<arr.length;i++){
			html+="<option value='"+arr[i].name+"'>"+arr[i].name+"</option>";
			
		}
		$("#routeNo").html(html);
	});
	
 	$.post("pole!findAll.action",function(data){
		var arr = eval("("+data+")");
		var html = $("#poleNo").html();
		for(var i =0;i<arr.length;i++){
			html+="<option value='"+arr[i].id+"'>"+arr[i].id+"</option>";
			
		}
		$("#poleNo").html(html);
	
	}); 
	


	
	
});

	function findcircuitry(pageIndex,pageSize){
	var circuitryName=$("#routeNo").val();
	var circuitryPoleByEndpoleNoId=$("#poleNo").val();
	console.log("circuitryName:"+circuitryName);
	$.post("route!findbypage.action",{
	"circuitry.name":circuitryName,
	"circuitry.poleByEndpoleNo.id":circuitryPoleByEndpoleNoId,
	"pageIndex":pageIndex,
	"pageSize":pageSize
	},function(data){
		var arr = eval("("+data+")");
		var rows = arr.rows;
		var html ="";
		for(var i =0;i<rows.length;i++){
				html+="<tr><td>"+rows[i].id+"</td><td>"+rows[i].name+"</td>";
				html+="<td>"+rows[i].length+"</td><td>"+rows[i].towercount+"</td>";
				html+="<td>"+rows[i].poleByStartpoleNo.id+"</td><td>"+rows[i].poleByEndpoleNo.id+"</td>";
				html+="<td>"+rows[i].state+"</td></tr>";
				/*html+="<td>"+arr[i].pid+"</td><td>"+level[arr[i].level-1]+"</td>";
				html+="<td>"+arr[i].typeName+"</td><td>"+arr[i].patroltask.time+"</td>";
				html+="<td>"+arr[i].time+"</td>";
				html+="<td>"+arr[i].userName+"</td><td>"+arr[i].description+"</td></tr>"; */
			}
			$("#info_list").html(html);
			var pager = pager2(arr,pageSize,"findcircuitry");
			$(".pagin").html(pager);
			$('#info_list tr:odd').addClass('odd');
	});
}


function selectRoute(){
	$.post("route!findPoliesByCid.action",{},function(data){
		var arr = eval("("+data+")");
		var html ="<option value='' selected='selected'>全部</option>";
		for(var i =0;i<arr.length;i++){
			html+="<option value='"+arr[i].name+"'>"+arr[i].name+"</option>";
		}
		$("#poleNo").html(html);
	
	});
}



</script>
</head>


	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">线路管理</a></li>
    <li><a href="#">线路查询</a></li>
    </ul>
    </div>
    
    <div class="formbody">
       
    <ul class="seachform">
    
    <li><label>线路名称</label>
     <div class="vocation">
    <select class="select3" id="routeNo" name="circuitry.name" onchange="selectRoute()">
      <option value="0">请选择</option>
    </select>
    </div>
    </li>
    <li><label>杆塔编号</label>
     <div class="vocation">
    <select class="select3" id="poleNo" name="circuitry.poleByEndpoleNo.id">
    <option value="0">请选择</option>
    </select>
    </div>
    </li>

    <li><label>&nbsp;</label><input name="" type="button" class="scbtn" value="查询" onclick="findcircuitry(1,10);"/></li>
    
    </ul>
    
      
	</div> 
   <table class="tablelist">
    	<thead>
    	<tr>
        <th>线路编号</th>
        <th>线路名称</th>
        <th>线路长度</th>
        <th>线路数量</th>
        <th>起始杆号</th>
        <th>终止塔杆</th>
        <th>电路状态</th>
        </tr>
        </thead>
        <tbody id="info_list">
       
       
       
        </tbody>
    </table>
 
	<div class="pagin">
     </div>
    
  
    
</body>
</html>
